#pragma once
#include "Hash.h"



namespace zsw
{
	template<class K, class Hash = Hash<K>>
	class set
	{
	public:
		struct SetKeyOfT
		{
			K operator()(const K& key)
			{
				return key;
			}
		};

		typedef typename HashTables<K, K, Hash, SetKeyOfT>::const_iterator iterator;
		typedef typename HashTables<K, K, Hash, SetKeyOfT>::const_iterator const_iterator;

		iterator begin()
		{
			return _ht.begin();
		}

		iterator end()
		{
			return _ht.end();
		}

		const_iterator begin() const
		{
			return _ht.begin();
		}

		const_iterator end() const
		{
			return _ht.end();
		}

		pair<iterator, bool> insert(const K& key)
		{
			return _ht.insert(key);
		}

		bool erase(const K& key)
		{
			return _ht.erase(key);
		}

		iterator find(const K& key)
		{
			return _ht.find(key);
		}


	private:
		HashTables<K, K, Hash, SetKeyOfT> _ht;
	};
}